export const success = (code: number, message: string, data?: any): ResultOptions => {
  return { code, message, data };
};

export const failure = (code: number, message: string): ResultOptions => {
  return { code, message };
};

export const message = success;

export const error = failure;

export class Result {
  /**
   * 成功返回
   */
  static ok = success;

  /**
   * 失败返回
   */
  static fail = failure;
}
